﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="slide.aspx.cs" Inherits="weikeweixin.web.admin.website.slide" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="Keywords" content="IdeaSoft软件" />
        <meta name="Description" content="IdeaSoft软件" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/bootstrap.min.css?v=<%=Application["v"] %>" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/bootstrap.responsive.min.css?v=<%=Application["v"] %>" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/style.css?v=<%=Application["v"] %>" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/themes.css?v=<%=Application["v"] %>" />
    <link href="/css/Bootstrap/todc_bootstrap.css?v=<%=Application["v"] %>" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/inside.css?v=<%=Application["v"] %>" />

    <script type="text/javascript" src="/Scripts/JQuery.min.js?v=<%=Application["v"] %>"></script>
    <script type="text/javascript" src="/Scripts/Bootstrap.min.js?v=<%=Application["v"] %>"></script>
    <script type="text/javascript" src="/Scripts/JQuery.cookie.js?v=<%=Application["v"] %>"></script>
    <script type="text/javascript" src="/Scripts/JQuery.form.wizard.min.js?v=<%=Application["v"] %>"></script>
    <script type="text/javascript" src="/Scripts/Inside.js?v=<%=Application["v"] %>"></script>
    <script type="text/javascript" src="/Scripts/JQuery.form.min.js?v=<%=Application["v"] %>"></script>
    <script type="text/javascript" src="/Scripts/JQuery.validate.min.js?v=<%=Application["v"] %>"></script>
    <script type="text/javascript" src="/Scripts/JQuery.validate.methods.js?v=<%=Application["v"] %>"></script>

<title>IdeaSoft软件</title>
</head>
   
<style>
    .i-cont {
        color: #FFF;
        position: relative;
        width: 30px;
        padding: 5px;
    }

    .i-cont .sel-icon {
        color: #FFF;
    }

    .i-cont i {
        font-size: 30px;
    }
</style>
<body>
    <div id="main">
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <div class="box">
                        <div class="box-title">
                            <div class="span12">
                                <h3><i class="icon-table"></i>首页幻灯片</h3>
								<a class="btn preview pull-right btn-success" href="javascript:;">微官网预览</a>
                                <script type="text/javascript">
                                    $("a.preview").click(function () {
                                        if ($.browser.msie) {
                                            alert("不支持在IE浏览器下预览，建议使用谷歌浏览器或者360极速浏览器或者直接在微信上预览。");
                                            return;
                                        }

                                        var top = ($(window.parent.parent).height() - 480) / 2;
                                        var left = ($(window.parent.parent).width() - 320) / 2;
                                        var previewUrl = "http://" + window.location.host + "/phone/home?userid=" + "<%=user_id %>";

                                        window.open(previewUrl, "我的微官网", "height=480,width=320,top=" + top + ",left=" + left + ",toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");
                                    });
                                </script>
                            </div>
                        </div>
                        <div class="box-content">
                            <div class="row-fluid">
                                <div class="span8 control-group">
                                    <a href="slideadd.aspx" class="btn"><i class="icon-plus"></i>添加幻灯片</a>
                                </div>
                            </div>
                            <div class="row-fluid dataTables_wrapper">

                              <table id="listTable" class="table table-bordered table-hover dataTable">
                                 <thead>
                                    <tr>
                                        <th>幻灯片名称</th>
                                        <th>显示顺序</th>
                                        <th>展示</th>
                                        <th>事件类型</th>
                                        <th>事件行为</th>
                                        <th>是否显示</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>

                              </table>
                          </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>	
</html>
<script src="/Scripts/Su.common.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        var url = "slide.aspx";
        $.ajax({
            url: url + "?action=bindhomead",
            type: "post",
            success: function (msg) {
                msg = eval("(" + msg + ")");
                var str = "";
                for (var i = 0; i < msg.length; i++) {
                    str += '<tr><td>' + msg[i].Name + '</td><td>' + msg[i].Sort + '</td>';
                    str += '<td><img type="img" src="' + msg[i].PicUrl + '" style="max-height:50px;" /></td>';
                    str += '<td>' + GetType(msg[i].Type) + '</td><td>' + msg[i].Href + '</td><td><span class="label label-satgreen">' + GetStatus(msg[i].Status) + '</span></td>';
                    str += '<td><a href="slideadd.aspx?Id=' + msg[i].Id + '" class="btn">编辑</a>';
                    str += '<a href="javascript:Delete(' + msg[i].Id + ')" class="btn">删除</a></td><tr>';
                }
                $("#listTable").append(str);
            }
        });
    })
    function GetType(type) {
        switch (type) {
            case "articlelist":
                return "图文列表";
            case "article":
                return "图文";
            case "link":
                return "链接";
            case "tel":
                return "电话";
        }
    }
    function GetStatus(Status) {
        switch (Status) {
            case "1":
                return "显示";
            case "0":
                return "隐藏";
        }
    }
    function Delete(Id) {
        G.ui.tips.confirm("确定要删除吗？", "slide.aspx?action=del&Id=" + Id);
    }

</script>